﻿using Microsoft.AspNetCore.Mvc;
using WMS.BasicData.Categorys;
using WMS.InventoryManagement.Differences;

namespace WMS.Web.Controllers.BasicData.Categorys
{
    public class CategoryController : Controller
    {
        private readonly ICategorysAppService _appService;

        public CategoryController(ICategorysAppService appService)
        {
            _appService = appService;
        }

        public IActionResult Index()
        {
            return View();
        }

        [HttpGet]
        public JsonResult GetCategory(string? productName, int page, int limit)
        {
            var pagedResult = _appService.GetListAsync(productName, page, limit);
            return Json(new { data = pagedResult, code = 0 });
        }
    }
}
